<?php
/**
 * View Agenda Attività LaFabbrica.org
 * 
 * @author     luigi.pastore (gigi@la-fabbrica.org)
 * @created    14-mag-2012
 * @package    LaFabbrica
 * @copyright  Copyright (c) 2011 Luigi Pastore
 */
?>
<link rel="stylesheet" type="text/css" href="/js/fullcalendar/fullcalendar.css" />
<script type="text/javascript" src="/js/fullcalendar/fullcalendar.js"></script>
<script type="text/javascript">
    //<![CDATA[
    $(document).ready(function() {
	
        var date = new Date();
        var d = date.getDate();
        var m = date.getMonth();
        var y = date.getFullYear();

        $('#calendar').fullCalendar({
            editable: true,aspectRatio: 2,
            theme: true,
            firstDay: 1,
            monthNames : ['Gennaio', 'Febbraio', 'Marzo', 'Aprile', 'Maggio', 'Giugno', 'Luglio',
                            'Agosto', 'Settembre', 'Ottobre', 'Novembre', 'Dicembre'],
            monthNamesShort : ['Gen', 'Feb', 'Mar', 'Apr', 'Mag', 'Giu', 'Lug',
                            'Ago', 'Sett', 'Ott', 'Nov', 'Dic'],
            dayNames: ['Lunedì', 'Martedì', 'Mercoledì', 'Giovedì', 'Venerdì', 'Sabato', 'Domenica'],
            dayNamesShort: ['Lun', 'Mar', 'Mer', 'Gio', 'Ven', 'Sab', 'Dom'],
            buttonText: {
                today:    'Oggi',
                month:    'Mese',
                week:     'Settimana',
                day:      'Giorno'
            },
            columnFormat : {
                month: 'ddd',    // Mon
                week: 'ddd d-M', // Mon 9/7
                day: 'dddd d-M'  // Monday 9/7
            },
            timeFormat: 'H:mm', // uppercase H for 24-hour clock
            axisFormat: 'H:mm',
            header: {
                    left: 'prev,next today',
                    center: 'title',
                    right: 'month,agendaWeek,agendaDay'
            },                        
            eventSources: [
                    {
                        url: '/admin/ajax/json/activities',
                        error: function() {
                            alert('there was an error while fetching events!');
                        }
                    }
                ],
            eventRender: function(event, element, jsEvent, view) {
                if(typeof element.data("qtip") !== "object") {
                    element.qtip({
                        content: {
                                text: '<div style="font-size:12px;color:#fff;">Info: <strong>' + event.desc +'</strong><br />'+ (event.startTimeIta != null ? 'Dalle: <strong>'+ event.startTimeIta +'</strong><br />' : '') +(event.endTimeIta != null ? 'Fino alle: <strong>'+ event.endTimeIta +'</strong>' : '') +'</div>'
                            },
                        show: { 
                            solo: true
                        },
                        position: {
                            my: 'bottom center',  // Position my top left...
                            at: 'top center' // at the bottom right of...
                        },
                        style: {
                            classes: 'ui-tooltip-shadow ui-tooltip-dark  ui-tooltip-rounded'
                        },

                        hide: { when: 'mouseout', fixed: true }
                    });
                }
            }
        });
		
    });
    //]]>
</script>

<div id="content">
    <div id="summary" class="activities">
        <div class="head activities">
            <h2>Elenco Attivit&agrave;</h2>
        </div>
        <div class="body">
            <div class="widget">
                <strong>Live Da Confermare</strong> 
                <var class="color1">11</var> 
                <em>Number</em>
            </div>
            <div class="widget">
                <strong>Recall</strong> 
                <var class="color1">11</var> 

            </div>

            <br class="clear"/>

        </div>	
    </div>
    <div class="help">
        <h2>Info</h2>
        <br/>Sono evidenziate le attivit&agrave; di oggi.
    </div>
    <form>
        <ul>
            <li class="addnew">
                <a class="button" href="/admin/attivita/info">
                    <img src="/images/admin/16x16/add-new.png" />Nuova Attivit&agrave;
                </a>
                <a class="button" href="/admin/attivita/">
                    <img src="/images/admin/calendar.png" />Vai a Elenco Attivit&agrave;
                </a>
            </li>
        </ul>
    </form>    
    <div id="calendar"></div>
</div>